package com.exercise.baseskill.design.observer;

/**
 * @Author 周春桂
 * @Date 2021/4/1 15:11
 * @Desciption 抽象观察者
 **/
public interface ObserverRole {
    void notify(int state);
}

/**
 * 具体观察者
 */
class ConcreteObserverOne implements ObserverRole{

    @Override
    public void notify(int state) {
        doSomething();
    }

    private void doSomething(){
        System.out.println("ConcreteObserverOne被通知变更");
    }
}
